package com.apex.crm.utils;

import org.apache.commons.lang3.StringUtils;

import javax.servlet.http.HttpServletRequest;

/**
 * @author XiaoYang
 * 从cookie中获取userId
 * @version 1.0
 * @program: crm
 * @Classname LoginUserUtil
 * @description TODO
 * @date 2021/4/21 13:49
 */

public class LoginUserUtil {
    public static int releaseUserIdFromCookie(HttpServletRequest request){
        String userIdString = CookieUtil.getCookieValue(request,"userIdStr");
        if(StringUtils.isBlank(userIdString)){
            return 0;
        }
        Integer userId= UserIDBase64.decoderUserID(userIdString);
        return userId;
    }
}
